import com.sun.jna.Callback;
import com.sun.jna.Library;
import com.sun.jna.Native;
import com.sun.jna.ptr.IntByReference;

public class Macitcsi2 {


    public interface CLibrary extends Library {


        class FileReceivedCallbackCallback  implements Callback {
            public static int invoke(int siteId, String fileName){
                System.out.println("fileReceived");
                return 0;
            }
        }

        class GetTmpFileNameCallback implements Callback {
            public static int  invoke(int deviceId, String filename, int nameLength){
                System.out.println("getTmpFileName");
                return 0;
            }
        }

        class GetCommunicationConfigCallback implements Callback {
            public static void invoke(int siteId, IntByReference pointer){
                System.out.println("getCommunicationConfig");
            }
        }

        void SetFileReceived(FileReceivedCallbackCallback fileReceivedCallbackCallback);

        void SetGetTmpFileName(GetTmpFileNameCallback getTmpFileNameCallback);

        void SetGetCommunicationConfig(GetCommunicationConfigCallback getCommunicationConfigCallback);

        void InitializeCSILibrary();

        boolean CreateCSIInstance(int deviceId, boolean bSquelchLogging);


    }


    public static void main(String[] args) throws InterruptedException {

        CLibrary lib = (CLibrary) Native.loadLibrary("C:\\workspace\\angel-bo\\angel-common\\src\\test\\java\\macitcsi.dll", CLibrary.class);



        lib.SetFileReceived(new CLibrary.FileReceivedCallbackCallback());
        lib.SetGetTmpFileName(new CLibrary.GetTmpFileNameCallback());
        lib.SetGetCommunicationConfig(new CLibrary.GetCommunicationConfigCallback());
        lib.InitializeCSILibrary();
        lib.CreateCSIInstance(6, true);

        Thread.sleep(10000);
    }
}





